home *** CD-ROM | disk | FTP | other *** search
- Listing 8 - non-inline member function definitions for a generic queue
- using void * and an nested iterator class
-
- //
- // genq5.cpp - generic queue of void *
- // with an iterator class
- //
-
- #include "genq5.h"
-
- void *genq::iterator::next()
- {
- void *pv = 0;
- if (pc != 0)
- {
- pv = pc->element;
- pc = pc->next;
- }
- return pv;
- }
-
- void genq::append(void *e)
- {
- // same as in Listing 2
- }
-
- int genq::remove(void *&e)
- {
- // same as in Listing 2
- }
-
-